package org.example.m6;

public class Address {
    private String street; // 街道（村）名称
    private String district; // 区
    private String city; // 城市
    private String province; // 省
    private String postalCode; // 邮编

    // 构造方法
    public Address(String street, String district, String city, String province, String postalCode) {
        this.street = street;
        this.district = district;
        this.city = city;
        this.province = province;
        this.postalCode = postalCode;
    }

    // 获取和设置方法
    public String getStreet() { return street; }
    public void setStreet(String street) { this.street = street; }

    public String getDistrict() { return district; }
    public void setDistrict(String district) { this.district = district; }

    public String getCity() { return city; }
    public void setCity(String city) { this.city = city; }

    public String getProvince() { return province; }
    public void setProvince(String province) { this.province = province; }

    public String getPostalCode() { return postalCode; }
    public void setPostalCode(String postalCode) { this.postalCode = postalCode; }

    // 展示成员属性的方法
    public void showInfo() {
        System.out.println("地址信息:");
        System.out.println("街道: " + street);
        System.out.println("区: " + district);
        System.out.println("城市: " + city);
        System.out.println("省份: " + province);
        System.out.println("邮编: " + postalCode);
    }
}
